Skip to content

IGNITE-27900 Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch, ClientCacheChangeDummyDiscoveryMessage#12780

Merged
anton-vinogradov merged 7 commits intoapache:masterfrom
abashev:feature/IGNITE-27900
Mar 24, 2026

Conversation

@abashev
Copy link
Copy Markdown
Contributor

@abashev abashev commented Feb 19, 2026

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@abashev abashev force-pushed the feature/IGNITE-27900 branch 2 times, most recently from 3325785 to f039f49 Compare February 24, 2026 15:27
@@ -41,13 +46,23 @@ public class CacheStatisticsClearMessage implements DiscoveryCustomMessage {
private final IgniteUuid id = IgniteUuid.randomUuid();
Copy link
Copy Markdown
Contributor

@shishkovilja shishkovilja Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All non-transient, non-static fields should be serialized. Also, inititalization of UUID can be moved to non default constructor.

@abashev abashev force-pushed the feature/IGNITE-27900 branch from f039f49 to 5f6f3fa Compare March 3, 2026 15:44
@abashev abashev requested a review from shishkovilja March 3, 2026 15:52
@abashev abashev force-pushed the feature/IGNITE-27900 branch from 5f6f3fa to 8bef005 Compare March 4, 2026 08:41
@abashev abashev changed the title IGNITE-27900 Use message serializer for CacheStatisticsClearMessage Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch Mar 17, 2026
@abashev abashev changed the title Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch, ClientCacheChangeDummyDiscoveryMessage Mar 17, 2026
Map<String, DynamicCacheChangeRequest> startReqs;

/** */
@Order(value = 1, method = "startRequestsBytes")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use MarshallableMessage instead


/** {@inheritDoc} */
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
if (startReqs != null && startRequestsBytes == null)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to check startRequestsBytes == null?

@abashev abashev force-pushed the feature/IGNITE-27900 branch from 39a7d6d to ea4e3a1 Compare March 17, 2026 14:30
@abashev abashev force-pushed the feature/IGNITE-27900 branch from ea4e3a1 to 2de8059 Compare March 17, 2026 19:51
@abashev abashev changed the title Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch, ClientCacheChangeDummyDiscoveryMessage IGNITE-27900 Use message serializer for CacheStatisticsClearMessage, ChangeGlobalStateMessage, DynamicCacheChangeBatch, ClientCacheChangeDummyDiscoveryMessage Mar 18, 2026
@abashev abashev force-pushed the feature/IGNITE-27900 branch from 2de8059 to c9fd669 Compare March 19, 2026 08:24
@github-actions
Copy link
Copy Markdown

Possible compatibility issues. Please, check rolling upgrade cases

This PR modifies protected classes (with Order annotation).
Changes to these classes can break rolling upgrade compatibility.

Affected files:

  • modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryCustomEventMessage.java

// TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-27627
public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
if (msg instanceof Message)
if (msg instanceof Message) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MarshallableMessage will be properly processed in MessageSerializer, this change is unnecessary.

return;

if (serMsg != null)
if (serMsg != null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MarshallableMessage will be properly processed in MessageSerializer, this change is unnecessary.

super(false);
}

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this change in this PR?

// (possibly due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122846).
if (U.isMacOs())
spi.setLocalAddress(F.first(U.allLocalIps()));
if (U.isMacOs()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why o we need this change in this PR?


msg = metricsMsgFilter.pollActualMessage(laps, msg);

// pollActualMessage() can return null when actualFirstLapMetricsUpdate or actualSecondLapMetricsUpdate
Copy link
Copy Markdown
Contributor

@shishkovilja shishkovilja Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any existing NPE case?


try {
if (msg instanceof MarshallableMessage)
((MarshallableMessage)msg).prepareMarshal(spi.marshaller());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already will be done in corresponding MessageSerializer, why do we need this?

abashev added 5 commits March 19, 2026 18:13
# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStatisticsClearMessage.java
# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
…ryMessage

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
@abashev abashev force-pushed the feature/IGNITE-27900 branch from adc27d0 to d7c283a Compare March 19, 2026 15:54
@abashev abashev force-pushed the feature/IGNITE-27900 branch from d7c283a to 8644e44 Compare March 19, 2026 20:13
# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9 New Code Smells (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@anton-vinogradov anton-vinogradov merged commit 614974f into apache:master Mar 24, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants